package org.hanyx.server;

import io.grpc.Server;
import io.grpc.ServerBuilder;

import java.io.IOException;

public class ServerBootstrap {

    private static final int port = 8977;

    public static void main(String[] args) throws IOException, InterruptedException {
        Server server = ServerBuilder
                .forPort(port)
                .addService(new HelloServiceImpl())
                .build()
                .start();
        System.out.println("server stared, listening on " + port);
        // 等待服务终止
        server.awaitTermination();
    }
}
